<%@ taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core" %>
<%@ taglib prefix="form" uri="http://www.springframework.org/tags/form" %>
<%@ page contentType="text/html;charset=UTF-8" language="java" %>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
<html xml:lang="sv" lang="sv" class="no-js">
<head>
    <title>Register</title>
    <style>
        .errorMsg {
            color: red;
        }
    </style>
</head>
<body>
    <form:form commandName="customer" method="post">
        <table>
            <tr>
                <td>Namn: </td>
                <td><input name="name" class="textInput"/></td>
            </tr>
            <tr>
                <td>Ålder: </td>
                <td><input name="age" class="textInput"/></td>
            </tr>
            <tr>
                <td>Stad: </td>
                <td><input name="city" class="textInput"/></td>
            </tr>
        </table>
        <input type="submit"/>
        <form:errors path="name"/>
        <form:errors path="age" cssClass="errorMsg"/>
        <form:errors path="city"/>
    </form:form>
    <c:if test="${customer.name != null}">
        Hej ${customer.name} ${customer.age} år från ${customer.city}
    </c:if>
</body>
</html>